package com.example.barcodeapp.ui.own.fragment;

import android.util.Log;

import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;

import com.example.barcodeapp.R;
import com.example.barcodeapp.adapter.ownadapter.AdapterOneDuiOne;
import com.example.barcodeapp.base.BaseFragment;
import com.example.barcodeapp.common.Constants;
import com.example.barcodeapp.interfaces.IBasePersenter;
import com.example.barcodeapp.interfaces.own.IOwn;
import com.example.barcodeapp.persenter.OnePresenterPeilianke;
import com.example.barcodeapp.ui.own.bean.KeChengBean;
import com.example.barcodeapp.ui.own.bean.PeiLianKeBean;
import com.example.barcodeapp.utils.Show;
import com.google.gson.Gson;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.net.HttpURLConnection;
import java.net.MalformedURLException;
import java.net.URL;
import java.util.Map;

import butterknife.BindView;

import static com.example.barcodeapp.common.Constants.kechengid;


public class FragmentOneDuiOne extends BaseFragment<IOwn.Persenterkechengpeilianke> implements IOwn.Viewkechengpeilianke {


    @BindView(R.id.oneduione_rv)
    RecyclerView oneduioneRv;

    @Override
    protected int getLayout() {
        return R.layout.fragment_one_dui_one;
    }

    @Override
    protected void initView() {

    }

    @Override
    protected OnePresenterPeilianke initPersenter() {
        return new OnePresenterPeilianke();
    }




    @Override
    protected void initData() {
        persenter.getPeilianKe(Constants.lanmuid,Constants.zilanmuid,0);
    }


    @Override
    public void getPeilianKe(PeiLianKeBean xiLieKeBean) {

        Log.e("sdawdadawdasda", "getPeilianKe: "+ xiLieKeBean.toString());
        AdapterOneDuiOne adapterMianFei = new AdapterOneDuiOne(getActivity(),xiLieKeBean.getData());
        LinearLayoutManager manager3 = new LinearLayoutManager(context);
        oneduioneRv.setLayoutManager(manager3);
        oneduioneRv.setAdapter(adapterMianFei);
    }
}